package com.sinping.qh.query.records;

import com.sinping.qh.query.base.Operator;
import com.sinping.qh.query.base.QueryParams;
import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author zhangjin
 * @create 2018/6/6
 */
@Data
public class HiddenDangerQuery implements QueryParams,Serializable {

    static Map<String, String> aliasMap = new HashMap<>();
    static Map<String, Operator> operatorMap = new HashMap<>();


    private String checkRecordId;


    private String hiddenDangerStatus;

    static {
        aliasMap.put("checkRecordId", "check_id");

        aliasMap.put("hiddenDangerStatus", "hidden_danger_status");


        operatorMap.put("checkRecordId", Operator.eq);

        operatorMap.put("hiddenDangerStatus", Operator.regex);

    }

    @Override
    public String getAlias(String fieldName) {
        return aliasMap.getOrDefault(fieldName, fieldName);
    }

    @Override
    public Operator getOperators(String fieldName) {
        return operatorMap.getOrDefault(fieldName, Operator.eq);
    }
}
